package sqlsource.impl;


import mapping.BoundSql;
import mapping.ParameterMapping;
import sqlsource.SqlSource;

import java.util.ArrayList;
import java.util.List;

/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2020-01-04 14:52
 * @notify RawSqlSource 和 DynamicSqlSource处理后的结构。
 * @version 1.0
 */
public class StaticSqlSource implements SqlSource {

    private String sql;
    private List<ParameterMapping> parameterMappings = new ArrayList<>();

    public StaticSqlSource(String sql, List<ParameterMapping> parameterMappings) {
        this.sql = sql;
        this.parameterMappings = parameterMappings;
    }

    @Override
    public BoundSql getBoundSql(Object param)throws Exception {
        return new BoundSql(sql,parameterMappings);
    }

}
